﻿@model HelloWorld.Code.DataAccess.Address
 
@if (Model == null)
{
    @:None
    <a href="#" class="edit-address">Edit</a>  
}
else if (Model.IsReadOnly)
{
    @Html.LabelFor(model => model.Street)@: <strong>@Model.Street</strong>
    <br/>
    @Html.LabelFor(model => model.ZipCode)@: <strong>@Model.ZipCode</strong>
    <br/>
    @Html.LabelFor(model => model.City)@: <strong>@Model.City</strong>
    <br/>
    @Html.LabelFor(model => model.Country)@: <strong>@Model.Country</strong>
    <br/>
    <a href="#" class="edit-address">Edit</a>          
}
else
{
    @Html.ValidationSummary(true)
  
    @Html.LabelFor(model => model.Street, new { @class = "control-label" })
    @Html.TextBoxFor(model => model.Street)
    @Html.ValidationMessageFor(model => model.Street)
    <br/>
    @Html.LabelFor(model => model.ZipCode, new { @class = "control-label" })
    @Html.TextBoxFor(model => model.ZipCode)
    @Html.ValidationMessageFor(model => model.ZipCode)
    <br/>
    @Html.LabelFor(model => model.City, new { @class = "control-label" })
    @Html.TextBoxFor(model => model.City)
    @Html.ValidationMessageFor(model => model.City)
    <br/>
    @Html.LabelFor(model => model.Country, new { @class = "control-label" })
    @Html.TextBoxFor(model => model.Country)
    @Html.ValidationMessageFor(model => model.Country)
    <br/>
    <a href="#" class="save-address">Save</a>     
}